#ifndef SCT_RTSPSERVER_AMRSOURCE_H
#define SCT_RTSPSERVER_AMRSOURCE_H

#include "sct/core/common.h"
#include "sct/rtspserver/streamsource.h"

#include "AMRAudioSource.hh"

namespace sct
{

class CAMRSource: public AMRAudioSource {
public:
  static CAMRSource* createNew(UsageEnvironment& env,
				       void* audio);

private:
  CAMRSource(UsageEnvironment& env, CStreamSource* audio,
		     Boolean isWideband, unsigned numChannels);
	// called only by createNew()

  virtual ~CAMRSource();

private:
  // redefined virtual functions:
  virtual void doGetNextFrame();
	virtual void doStopGettingFrames();

private:
	static void tryToGetNextFrame(void* p);

private:
//  FILE* fFid;

  CStreamSource * mSource;
	double mStartReadTime;
	TaskToken mReadTask;
};

}

#endif
